package com.stx.jeepay.core.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.stx.jeepay.core.entity.PayOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 支付订单表
 *
 * @author suntingxing
 * @email 1@gmail.com
 * @date 2023-09-11 13:05:22
 */
@Mapper
public interface PayOrderDao extends BaseMapper<PayOrderEntity> {

    /**
     * 交易统计
     *
     * @param param
     * @return
     */
    Map payCount(Map param);

    /**
     * 成功、退款订单统计
     *
     * @param param
     * @return
     */
    List<Map> selectOrderCount(Map param);

    /**
     * 支付方式统计
     *
     * @param param
     * @return
     */
    List<Map> payTypeCount(Map param);

    /**
     * 更新订单退款金额和次数
     **/
    int updateRefundAmountAndCount(@Param("payOrderId") String payOrderId, @Param("currentRefundAmount") Long currentRefundAmount);
}
